//new和delete
#include <iostream>
using namespace std;
void* operator new(size_t size){
    cout<<"调用了new的重载函数"<<endl;
    void* prt=malloc(size);
    return prt;
}
void operator delete(void* prt){
    cout<<"调用了delete的重载函数"<<endl;
    if(prt==NULL)return;
    free(prt); 
}
int main()
{
    int* arr=new int(3);
    cout<<"申请的内存地址是"<<(void*)arr<<endl;
    cout<<"*arr="<<*arr<<endl;
    delete arr;
    return 0;
}